<template>
  <!-- 当下拉到指定距离时触发load方法 -->
  <div
    v-infinite-scroll="load"
    :infinite-scroll-distance="1"
    :infinite-scroll-immediate="false"
    class="app"
  >
    <router-view />
  </div>
</template>

<script>
import pubsub from 'pubsub-js'
export default {
  name: 'App',
  methods: {
    load() {
      // 发布updateDate，表示该显示更多帖子了
      pubsub.publish('updateData')
    }
  }
}
</script>

<style lang="scss">
.app {
  height: 100vh;
  overflow: auto;
}
:root {
  width: 100%;
  min-width: 1500px;
  margin: 0 auto;
  background: url("./assets/images/background.jfif") no-repeat;
  background-size: cover;
  background-attachment: fixed;
  &::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}
</style>
